//订单列表页面接口
import request from '@/utils/axios-req'

//查询订单列表
export const orderInfoList = (query) => {
  return request({
    url: '/admin/purchaseOrder',
    method: 'get',
    params: query
  })
}

//新增订单信息
export const orderInfoAdd = (query) => {
  return request({
    url: '/admin/savePurchaseOrder',
    method: 'post',
    data: query
  })
}

//查询全部币别
export const getCurrency = (query) => {
  return request({
    url: '/admin/getAllCurrencyName',
    method: 'get',
    params: query
  })
}

//删除订单
export const orderInfoDelete = (id) => {
  return request({
    url: '/admin/deletePurchaseOrder',
    method: 'delete',
    params: { id }
  })
}

//获取供应商的编码
export const getSupplierCode = (query) => {
  return request({
    url: '/admin/suppliers/import',
    method: 'get',
    params: query
  })
}
//附件上传
export const orderimports = (query) => {
  return request({
    url: '/admin/upload',
    method: 'post',
    data: query
  })
}

//查询订单明细
export const orderDetail = (orderCode) => {
  return request({
    url: `/admin/orderDetails/orders/${orderCode}`,
    method: 'get'
  })
} 

//合同编号查询
export const getContractNumber = (query) => {
  return request({
    url: '/admin/orderDetails/getAllMaterials',
    method: 'get',
    params: query
  })
}

//订单明细添加
export const addOrderItem = (query) => {
  return request({
    url: '/admin/orderDetails/addOrderItem',
    method: 'post',
    params: query
  })
}
